import Vue from 'vue'
import App from './App.vue'
import router from './router'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css';
import axios from 'axios'
import VueWechatTitle from 'vue-wechat-title'
import VueCookies from "vue-cookies";
import baiduMap from 'vue-baidu-map'
import  VueQuillEditor from 'vue-quill-editor'
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
import $ from 'jquery';
window.jQuery = $;
window.$ = $;

const instance = axios.create({
    baseURL: "/api",
    timeout: 3000
})

// 添加请求拦截器
axios.interceptors.request.use(config => {
    let token = sessionStorage.getItem('eleToken')
    if (token) {
        config.headers['Authorization'] = token
    }
    return config
}, error => {
    return Promise.reject(error)
})

Vue.use(VueQuillEditor)
Vue.use(VueWechatTitle)
Vue.use(router)
Vue.use(ElementUI)
Vue.use(VueCookies);
Vue.use(baiduMap, {
  ak: ''
})
Vue.config.productionTip = false
Vue.prototype.axios = axios;


new Vue({
  render: h => h(App),
  router
}).$mount('#app')
